<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="../node_modules/bootstrap/dist/css/bootstrap.css">


</head>
<body>
    <div id="app">
        <span ref="s">{{a}}</span>
    </div>

</body>
<script src="../node_modules/vue/dist/vue.js"></script>
<script>
    let vm =  new Vue({
//        el: '#app',
        beforeCreate(){
            console.log(this);
        },
        created(){
            //ajax
            console.log(this.a);
        },
        beforeMount(){
            alert('mount')
        },
        mounted(){
            console.log(this.$refs.s)
        },
        beforeUpdate(){ //页面发生变化
            alert(1)
        },
        updated(){
            alert(2)
        },
        beforeDestroy(){
            //移除定时器，移除事件绑定
            alert('Destroy(')
        },
        destroy(){

        },
       // template:"<div>hello</div>",
        data:{
            a:'爱心',
            b:''

        }

    }).$mount('#app');
    vm.$destroy();


</script>
</html>